class RhymesController < ApplicationController

  def index
    @word = Word.find_by_id(params[:word_id], :include => :rhymes)

    unless @word
      @div = :din_content
      @class_name = 'rhyme'
      render :template => 'shared/error' and return
    end

    if @word.rhymes.empty?
      @word.synchronise_related_terms
      @word.rhymes.reload
    end

    @rhymes = @word.rhymes.paginate(:page => params[:page],
                                    :per_page => 5)
  end
  
end
